package com.meeruu.sg.account.core.domain.vo.account;

import com.meeruu.sg.account.core.api.constant.AccountGroup;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author yangqintao
 * @date 2019-06-10
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AccountSortVo implements Comparable<AccountSortVo> {

    /**
     * 账户id
     */
    private String accountId;

    /**
     * 所属组别
     */
    private AccountGroup accountGroup;

    public static AccountSortVo getInstance(String accountId, AccountGroup accountGroup) {
        return AccountSortVo.builder().accountId(accountId).accountGroup(accountGroup).build();
    }


    /**
     * 按accountId排序
     *
     * @param obj
     */
    @Override
    public int compareTo(AccountSortVo obj) {
        return this.accountId.compareTo(obj.accountId);
    }

}
